package core

func GetDataAddr(left, top int) string {
	searchXY := &XYD{left, top, ""}
	item := tr.Get(searchXY)
	if item == nil {
		// fmt.Println("未找到")
		return ""
	}
	xyd, ok := item.(*XYD)
	if ok {
		return xyd.Addr
	}
	return ""
}

func GetDataAddr_Old(left, top int) string {
	//
	if top == 691 {
		if left == 1062 {
			return "st01_left"
		} else if left == 1152 {
			return "st02_left"
		} else if left == 1242 {
			return "st03_left"
		} else if left == 1332 {
			return "st04_left"
		} else if left == 1423 {
			return "st05_left"
		} else if left == 1513 {
			return "st06_left"
		} else if left == 1603 {
			return "st07_left"
		} else if left == 1693 {
			return "st08_left"
		}
	} else if top == 696 {
		if left == 1097 {
			return "st01_right"
		} else if left == 1187 {
			return "st02_right"
		} else if left == 1277 {
			return "st03_right"
		} else if left == 1367 {
			return "st04_right"
		} else if left == 1458 {
			return "st05_right"
		} else if left == 1548 {
			return "st06_right"
		} else if left == 1638 {
			return "st07_right"
		} else if left == 1728 {
			return "st08_right"
		}
	} else if left == 103 {
		if top == 801 {
			return "id_1"
		} else if top == 828 {
			return "id_2"
		} else if top == 853 {
			return "id_3"
		}
	} else if left == 143 {
		if top == 801 {
			return "length_1"
		} else if top == 828 {
			return "length_2"
		} else if top == 853 {
			return "length_3"
		}
	} else if left == 203 {
		if top == 801 {
			return "width_1"
		} else if top == 828 {
			return "width_2"
		} else if top == 853 {
			return "width_3"
		}
	} else if left == 263 {
		if top == 801 {
			return "thickness_1"
		} else if top == 828 {
			return "thickness_2"
		} else if top == 853 {
			return "thickness_3"
		}
	} else if left == 303 {
		if top == 801 {
			return "dest1_1"
		} else if top == 828 {
			return "dest1_2"
		} else if top == 853 {
			return "dest1_3"
		}
	} else if left == 343 {
		if top == 801 {
			return "dest2_1"
		} else if top == 828 {
			return "dest2_2"
		} else if top == 853 {
			return "dest2_3"
		}
	}
	//
	if left == 146 && top == 747 {
		return "gross_width"
	}

	return ""
}
